package com.njtoyo.taxi.admin.rest.wrapper.open.on_call;

import com.njtoyo.taxi.admin.library.common.GeoPoint;
import com.njtoyo.taxi.admin.mapper.master.enums.OnCallBackLogContactWho;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@ApiModel("电召发单类型")
public class CreateWrapper {
    @NotBlank(message = "来电人手机号不能为空")
    private String callerMobileNumber;

    @Valid
    @NotNull(message = "乘车人信息不能为空")
    private Customer customer;

    @Valid
    @NotNull(message = "出发点信息不能为空")
    private Location origin;

    @Valid
    @NotNull(message = "目的地信息不能为空")
    private Location destination;
    
    @NotNull(message = "期望用车时间不能为空")
    private Long expectTimestamp;

    @NotNull(message = "联系对象不能为空")
    private OnCallBackLogContactWho contactWho;
    
    private String callbackUrl;

    @Data
    public static class Customer {
        @NotBlank(message = "乘车人姓名不能为空")
        private String name;

        @NotBlank(message = "乘车人手机号不能为空")
        private String mobileNumber;
    }
    
    @Data
    public static class Location {
        @NotBlank(message = "adcode 不能为空")
        private String adcode;
        
        @NotBlank(message = "地址名称")
        private String name;
        
        @NotNull(message = "地址坐标")
        private GeoPoint location;
    }
}
